<template>
    <div class="nav">
        <div class="left">
            <RouterLink to="/child" active-class="ac">子路由</RouterLink>
        </div>
        <div class="right">
            <RouterView></RouterView>
        </div>
    </div>
</template>

<script setup>
import { RouterLink, RouterView } from 'vue-router';
</script>

<style scoped>
*,
html,
body {
    margin: 0;
    padding: 0;
}

body {
    background-color: rgb(236, 166, 61);
}

h1 {
    text-align: center;
    color: rgb(224, 71, 97);
}

.nav {
    display: flex;
    margin: 20px auto;
    width: 100%;
    height: 850px;
}

.nav .left {
    display: flex;
    padding: 10px;
    flex-direction: column;
    flex: 0.5;
    border: 1px pink solid;
    font-size: 16px;
}

.nav .left a {
    padding: 20px;
    border-radius: 5px;
    margin: 5px auto;
    text-decoration: none;
    color: rgb(224, 71, 97);
}

.nav .left a:hover,
.ac {
    background-color: pink;
    color: #fff;
    transition: all 1s;
}

.nav .right {
    padding: 10px;
    color: rgb(224, 71, 97);
    flex: 3;
    text-align: center;
    font-size: 18px;
    border: 1px pink solid;
    border-left: none;
}
</style>